// 全部选中
function checkAll(form, objName)
{
	for (var i = 0; i < form.elements.length; i++)
	{
		var e = form.elements[i];
	    if (e.name == objName && e.disabled == false)
			e.checked = form.chkAll.checked;
	}
}

// 全部选中
function checkAll2(form, objName)
{
	for (var i = 0; i < form.elements.length; i++)
	{
		var e = form.elements[i];
	    if (e.name == objName && e.disabled == false)
			e.checked = true;
	}
}

// 全部取消
function uncheckAll2(form, objName)
{
	for (var i = 0; i < form.elements.length; i++)
	{
		var e = form.elements[i];
	    if (e.name == objName && e.disabled == false)
			e.checked = false;
	}
}

//判断是否选中
function isChecked(objName)
{
	var names = document.getElementsByName(objName);
	//alert(names.length);
	var b = false;
	for(var i = 0; i < names.length; i++) {
		if(names[i].checked) {
			b = true;
			break;
		}
	}
	return b;
}

// 取消选中
function uncheck(objName)
{
	var names = document.getElementsByName(objName);
	var b = 0;
	for(var i = 0; i < names.length; i++) {
		if(names[i].checked) {
			names[i].checked = false;
		}
	}
}

//判断是否选中
function isCheckMany(objName)
{
	var names = document.getElementsByName(objName);
	//alert(names.length);
	var j = 0;
	for(var i = 0; i < names.length; i++) {
		if(names[i].checked) {
			j++;
		}
	}
	
	if (j>1) {
		return true;
	} else {
		return false;
	}
}
// 取得选中的ID
function getCheckValue(objName) {

	var names = document.getElementsByName(objName);

	for(var i = 0; i < names.length; i++) {
		if(names[i].checked) {
			return names[i].value;
		}
	}
	return "";
}

// 取得选中的ID
function getCheckValueMany(objName) {

	var names = document.getElementsByName(objName);
	
	var v = ""

	for(var i = 0; i < names.length; i++) {
		if(names[i].checked && objName != "checkbox") {
			v+=  names[i].value + ",";
		}
	}
	return v;
}